<!DOCTYPE html>
<html>
<head>
  <#assign secSelect = JspTaglibs["http://www.casic304.cn/secSelect"] />

  <meta charset="utf-8">
    <title>任务计划明细</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${ctx}/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/iconfont/iconfont.css"/>
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/style/qbdms.css">
    <script type="text/javascript">
        var __ctx = "${ctx}";
    </script>
  <style>
    .qbdms-TBinformation {
      margin-left: 0;
      font-size: 15px
    }
    .qbdms-TBinformationText {
      margin-left: 145px;
    }
    .fillBtn{
      background:rgba(38,130,255,1) !important;
    }
  </style>
    <#if isClose == 'true'>
        <style>
            .listBody .qbdms-bodyDiv{padding: 0 }
            body.qbdms-particulars .qbdms-bodyDiv div.layui-table-view-body{padding: 16px}
        </style>
    </#if>
</head>
<body class="listBody qbdms-particulars">
<#if flag !="1"&&flowStatus!='0'>
<div id="button" style="padding: 20px">
  <a class="layui-btn layui-btn-sm fillBtn" lay-event="" id="detail">
    <i class="iconfont iconicon_file"></i>
    <span>运行明细</span>
  </a>
  <a class="layui-btn layui-btn-sm flowChart fillBtn" lay-event="flowChart">
    <i class="layui-icon layui-icon-picture-fine"></i>
    <span >流程图</span>
  </a>
  <a class="layui-btn layui-btn-sm fillBtn" lay-event="" id="taskOpinion">
    <i class="iconfont iconicon_compile"></i>
    <span>审批历史</span>
  </a>
</div>
</#if>
<div class="qbdms-bodyDiv">
    <div class="layui-table-view-body qbdms-add-view-body" >
        <#if isClose != 'true'><div class="qbdms-formTitle">任务计划明细 <#if flag !="1"><i class="qbdms-returnOn closeWindow">返回</i></#if></div></#if>
        <form class="layui-form" requrl="${ctx}/qbdms/wQbdFalProblemreset/getPlan" lay-filter="wQbdFalProblemPlanDataForm">
            <div class="" style="width: 100%;overflow-x: hidden">
                <table class="tableExcel qbdms-zeroTable" width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr id="tbxx"></tr>

                        <tr>
                                <td class="qbdms-zeroTable-lable">措施内容</td>
                                <td name="content"></td>
                        </tr>
                        <tr>
                                <td class="qbdms-zeroTable-lable">计划完成时间</td>
                                <td name="planEndTime"></td>
                        </tr>
                        <tr>
                                <td class="qbdms-zeroTable-lable">责任人</td>
                                <td name="userName"></td>
                        </tr>
                        <tr>
                                <td class="qbdms-zeroTable-lable">落实情况</td>
                                <td name="situation"></td>
                        </tr>
                        <tr>
                                <td class="qbdms-zeroTable-lable">见证材料</td>
                          <td colspan="5">
                            <div class="uploadFileList" fileUploadName="material"></div>
                          </td>
                        </tr>

                    <#if flag=='1'>
                        <tr>
                            <td class="qbdms-zeroTable-lable">型号主管助理员审批</td>
                            <td colspan="5">
                                <#list taskOpinionNewList as taskOpinionNewList>
                                        <#if taskOpinionNewList.taskName == "型号主管助理员审批">
                                        <p>${taskOpinionNewList.opinion}</p><br/>
                                        <p style="text-align:right;">审批人:${taskOpinionNewList.exeFullname}&nbsp&nbsp&nbsp&nbsp
                                            日期:${(taskOpinionNewList.endTime?string("yyyy-MM-dd"))!}</p>
                                    </#if>
                                </#list>
                            </td>
                        </tr>

                        <tr>
                            <td class="qbdms-zeroTable-lable">型号主管副总师审批</td>
                            <td colspan="5">
                                <#list taskOpinionNewList as taskOpinionNewList>
                                <#if taskOpinionNewList.taskName == "型号主管副总师审批">
                                <p>${taskOpinionNewList.opinion}</p><br/>
                                <p style="text-align:right;">审批人:${taskOpinionNewList.exeFullname}&nbsp&nbsp&nbsp&nbsp
                                    日期:${(taskOpinionNewList.endTime?string("yyyy-MM-dd"))!}</p>
                            </#if>
                        </#list>
                        </td>
                        </tr>

                        <tr>
                            <td class="qbdms-zeroTable-lable">质量综合助理员确认</td>
                            <td colspan="5">
                                <#list taskOpinionNewList as taskOpinionNewList>
                                <#if taskOpinionNewList.taskName == "质量综合助理员确认">
                                <p>${taskOpinionNewList.opinion}</p><br/>
                                <p style="text-align:right;">审批人:${taskOpinionNewList.exeFullname}&nbsp&nbsp&nbsp&nbsp
                                    日期:${(taskOpinionNewList.endTime?string("yyyy-MM-dd"))!}</p>
                            </#if>
                        </#list>
                        </td>
                        </tr>

                    </#if>
                    </tbody>
                </table>

                            <input name="planEndTime" type="hidden" placeholder="未填写" autocomplete="off" class="layui-input dateTimeFiled input-right time-init" format="yyyy-MM-dd" datetype="date" />
            </div>
          <#if flag!='1'>
            <div class="layui-form-item btnformItem">
                <p>
                    <button type="reset" id="closeWindow" class="layui-btn layui-btn-sm btn-save qbdms-oneBtnLine">返回</button>
                </p>
            </div>
            </#if>
        </form>
    </div>
</div>
<script src="${ctx}/public/component.js" type="text/javascript"></script>
<script src="${ctx}/json/comboselect.js" type="text/javascript"></script>
<script src="${ctx}/qbdmsStatic/public/configFile.js"></script>
<script src="${ctx}/layui/layui.js"></script>
<script>
    layui.config({
        base: serverPath.qbdmsPath + staticPath.qbdmsPath //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'setter','common', 'jquery', 'propsHandle','publicMethods', 'qbdmsForm'], function () {
        // -----常量声明----------
        var $ = layui.jquery,
            laydate = layui.laydate,
            setter = layui.setter,  // 配置信息
            common = layui.common,
            propsHandle = layui.propsHandle,
            publicMethods = layui.publicMethods,
            form = layui.qbdmsForm;
        $(".subContTem").hide()

        var defProps = {
            //viewMould: 'form/formDef/view/formDesign/moulds/', // 组件模块 存放文件 *****
            viewMould: 'moulds/', // 组件模块 存放文件 *****
            selectorBtn: '.selectorBtn'
        };
        var temQuery = new propsHandle();  // 实例化模板功能部分
        temQuery.initTem({
            selectorBtn: defProps.selectorBtn,
            selectorTemPath: setter.views + defProps.viewMould
        });

        var dateTimeFiledLen = $(".dateTimeFiled");
        for (var i = 0; i < dateTimeFiledLen.length; i++) {
            laydate.render({
                elem: dateTimeFiledLen[i] //指定元素
                , type: 'date'
                , trigger: 'click'
            });
        }
        //关闭当前页面
        //关闭当前页面
        $("#closeWindow,.closeWindow").click(function () {
            window.location.href ='${ctx}/qbdms/wQbdFalProblemreset/view/list';
        });


        var procInstId = "${processRun.procInstId}";
        var runId = "${runId}";
        if (runId == null || runId == '') {
            $("#hideAndShow").show();
        }

        //运行明细
        $("#detail").click(function () {
          layer.open({
            type: 2,
            title: "运行明细",
            area: ['80%', '80%'],
            btn: ['关闭'],
            skin: 'btn-close',
            btnAlign: 'c',
            content: serverPath.qbdmsPath +'/workflow/processRun/view/detail?runId=' + runId
          });
        });

        //审批历史
        $("#taskOpinion").click(function () {
          parent.layer.open({
            type: 2,
            title: "审批历史",
            area: ['950px', '585px'],
            content: serverPath.qbdmsPath +"/workflow/taskOpinion/view/list?runId=" + runId
          })
        });

        //流程图
        $(".flowChart").click(function () {
          parent.layer.open({
            type: 2,
            title: "流程图",
            shade: 0.3,
            left: 200,
            area: ['1000px', '600px'],
            content: serverPath.qbdmsPath +"/workflow/processRun/view/bpmImg?procInstId="+procInstId+"&runId="+runId,
            btn:['','关闭'],
            success:function (layero,index) {
              $(layero).find("a.layui-layer-btn0").hide();
            }
          });
        });


        var common = layui.common;
        common.updateForm({
            name: 'wQbdFalProblemPlanDataForm',
            idValue: "${id}",
            primary: "id",
          getCallback: function (data) {
            //-修改页面 初始化附件组件 开始 ------------------------------------------
            $('.uploadFileList').each(function () {
              var fileUploadName = $(this).attr("fileUploadName");
              var jsonFile = data.data[fileUploadName];
              var files = eval(jsonFile);

              if (files) {
                for (var i = 0; i < files.length; i++) {
                  var fileLevel = files[i].fileLevel;
                  var fileLevelText = files[i].fileLevelText;
                  var fileSec = '<div class="fileSecLevel fileSecXg layui-input-inline">' + '<@secSelect.sec_select data_src=1 hasBlank=false/>' + "</div>";
                  var newStr = '<span class="file-id" style="margin-right: 20px;" fileId=' + files[i].fileId + ' fileLevelText="' + fileLevelText + '">' + fileSec + '<span class="file-name" title="点击下载文件" onclick="downFile(this)">' + files[i].fileName + '</span></span>';
                  $(this).append(newStr);
                  $(this).find("select:last").val(fileLevel);
                  $(this).find("select:last").attr("disabled", "disabled");
                }
              } else {
                $(this).html("<span style='color: #c0c4cc'>未上传</span>");
              }
            });
          }
        });
      window.downFile = function (obj) {
        var fileId = $(obj).parents("span").attr("fileId");
        window.location.href = serverPath.qbdmsPath + setter.extendLinkPath + "attachFile/download?fileId=" + fileId;
      };
    });
</script>
</body>
</html>